package Main;

/**
 * Contains constants for the user interface text, database connection
 * and other constants used in the SoderS Bokhandel.
 * 
 * @author Daniel Fagerberg
 * @author Johan Envik
 *
 */
public class Constants {
	//Data
	public static final String DB_URL_CREATE = "jdbc:derby:soders3_db;create=true";
	public static final String DB_URL_SHUTDOWN = "jdbc:derby:soders3_db;shutdown=true";
	public static final String DB_DRIVER = "org.apache.derby.jdbc.ClientDriver";
	public static final String USERNAME_FIELD = "username";
	public static final String PASSWORD_FIELD = "password";
	
	public static final String SELECT_SELLER = "SELECT name, email, phonenr FROM seller WHERE id_seller = ::id_seller";
	public static final String INSERT_SELLER = "insert into seller(id_seller, name, email, phonenr)"
		+ " values (DEFAULT, '::name', '::email', '::phonenr')";
	public static final String INSERT_BOOK = "insert into book (id_book, title, author, ISBN, edition, "
		+ "condition, subject, price, date_created, sold, seller_id_seller) "
		+ "values(DEFAULT, '::title', '::author', ::isbn, '::edition', '::condition', '::subject', "
		+ "::price, '::date', ::issold, ::id_seller)";
	public static final String SELECT_BOOK = "SELECT title, author, ISBN, edition, condition, subject, price, date_created, sold  FROM book WHERE id_book = ::id"; 
	public static final String DELETE_BOOK ="DELETE FROM book WHERE id=::id";
	
	public static final String SQL_DATE_FORMAT = "yyyy-MM-dd";
	

	//fee for the seller of the book
	public static final int FEE_PRICE = 30;

	public static final String FREE_SEARCH_BOOKS = "SELECT * FROM book b\n" +
			"WHERE lower(title) LIKE lower('%::string%')" +
			"OR lower(author) LIKE lower('%::string%')" +
			"OR char(ISBN) LIKE ('%::string%')" +
			"order by b.title";
	
	//Table model headers
	public static final String COLUMN_TITLE = "Titel";
	public static final String COLUMN_AUTHOR = "F\u00F6rfattare";
	public static final String COLUMN_ISBN = "ISBN";
	public static final String COLUMN_SUBJECT = "\u00C4mne";
	public static final String COLUMN_EDITION = "Upplaga";
	public static final String COLUMN_CONDITION = "Skick";
	public static final String COLUMN_PRICE = "Pris";
	public static final String COLUMN_SELLER = "S\u00C4ljare";
	
	//Presentation
	public static final String FONT = "Arial";
	public static final int FONT_SIZE = 16;
	public static final String LOGIN_WRONG_PWD = "Lösenordet du har uppgivit är fel. Försök igen.";
	public static final String LOGIN_FAILED = "Inloggning misslyckades";
	public static final String LOGIN_NO_PWD_ENTERED = "Du har inte fyllt i något lösenord!";
	public static final String LOGIN = "Logga in";
	public static final String LOGIN_TEXT = "Inloggning för administratör";
	public static final String REMOVE_BOOK = "Är du säker på att du vill ta bort boken?";
	public static final String CONFIRM_REMOVE_BOOK = "Bekräfta borttag av bok";
	public static final String CONFIRM_SELL = "Bekräfta försäljning";
	
	//Tooltips
	public static final String TT_BOOK_TITLE = "Bokens namn";
	public static final String TT_BOOK_ISBN = "Bokens ISBN (endast numeriska värden)";
	public static final String TT_BOOK_AUTHOR = "Bokens författare";
	public static final String TT_BOOK_EDITION = "Vilken upplaga av boken är det?";
	public static final String TT_BOOK_PRICE = "Bokens pris";
	public static final String TT_SELLER_NAME = "Säljarens namn";
	public static final String TT_SELLER_MAIL = "Säljarens e-postadress";
	public static final String TT_SELLER_PHONE = "Säljarens telefonnummer";
}